Repository navigation
fix(id/web): unmatched backtick no longer disables newline-destination protection (#7557) - #8061
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Agent note — task 17247 picked up (lane any-c)
|
…n protection (#7557) Port of the original PR #8061 commit onto current main (task 17247): the target code moved from pkgs/id/src/web/markdown.rs to pkgs/id/crates/id-web/src/markdown/parse_helpers.rs in the crate split, and a rebase conflicted across the whole file, so the change was re-applied at the new location. protect_newline_destinations now only opens an inline code span when an equal-length backtick run closes it within the same paragraph (code_span_closes_within_paragraph), and resets span state at blank lines; an unmatched run stays literal per CommonMark and can no longer disable destination protection for the rest of the document. The #7557 regression test is ported unchanged. cargo test -p id-web --lib markdown: 293 passed, 0 failed.
d5f133e to
cda1587
Compare
|
Agent note — task 17247 done: fixed_merged (lane any-c)
|
Fixes #7557 (queue task 14420).
protect_newline_destinationstracked an open inline code span that only an equal-length backtick run closed, carried across blank lines and every other block boundary to end of document. One stray/unmatched backtick in prose therefore disabled newline-destination protection for the rest of the document — the load/save link corruption the protection exists to prevent.Fix (CommonMark oracle: an unmatched backtick run is literal text):
code_span_closes_within_paragraphlookahead); paragraph end = blank line (whitespace-only lines count) or EOF.Verification (on the laptop,
pkgs/id):cargo test --features web test_newline_destination— 2 passed: newtest_newline_destination_protection_unmatched_backtick(stray single/double run, same-paragraph and later-paragraph destinations protected; closed span after a stray stays literal) and the pre-existing id(web): #1543's newline-destination protection rewrites literal code text (code spans, indented blocks, long fences) and joins destinations across whitespace blank lines #1707test_newline_destination_protection_skips_literal_contexts.cargo test --features web web::markdown— 267 passed, 0 failed.rustfmt --checkon the touched file: clean.web/distembed folder; a local placeholder was used for the test build only and is not part of this change (diff is the single markdown.rs file).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.